import type { PermissionRecord } from './Permission';
import type { PermissionTreeNode } from './User';

export interface RoleRecord {
  id: number;
  name: string;
  znName: string;
  rolePermissions: {
    permission: PermissionRecord;
  }[];
  permissionList: PermissionRecord[];
  permissionTree: PermissionTreeNode[];
  isSuper: RoleIsSuper;
}

export enum RoleIsSuper {
  Yes = '1',
  No = '0',
}

export const RoleIsSuperMap = {
  [RoleIsSuper.Yes]: {
    text: '超级管理员',
    status: 'error',
  },
  [RoleIsSuper.No]: {
    text: '普通角色',
    status: 'success',
  },
};
